package burubaka.model;

import java.io.Serializable;
import java.util.Date;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;
import org.slim3.datastore.json.Json;

import burubaka.common.coder.DateCoder;

import com.google.appengine.api.datastore.Key;

@Model(schemaVersion = 1)
public class RaceInfo implements Serializable {

	private static final long serialVersionUID = 1L;

	@Attribute(primaryKey = true)
	private Key key;

	@Attribute(version = true)
	private Long version;

	private String raceDate = null;
	private String raceName = "";
	private String raceInfo1 = "";
	private String raceInfo2 = "";
	private String raceInfo3 = "";
	private String kaisaiNo = "";
	private String raceNo = "";
	@Attribute(json = @Json(coder = DateCoder.class))
	private Date startTime;
	@Attribute(json = @Json(coder = DateCoder.class))
	private Date deadline;
	private String districtClass;
	private int progress = 0;
	private int currentFlg = 0;
	private String raceURL = "";

	@Attribute(json = @Json(ignore = true))
	private Date createdDate = new Date();

	/**
	 * Returns the key.
	 * 
	 * @return the key
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * Sets the key.
	 * 
	 * @param key
	 *            the key
	 */
	public void setKey(Key key) {
		this.key = key;
	}

	/**
	 * Returns the version.
	 * 
	 * @return the version
	 */
	public Long getVersion() {
		return version;
	}

	/**
	 * Sets the version.
	 * 
	 * @param version
	 *            the version
	 */
	public void setVersion(Long version) {
		this.version = version;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

	public String getRaceDate() {
		return raceDate;
	}

	public void setRaceDate(String raceDate) {
		this.raceDate = raceDate;
	}

	public String getRaceName() {
		return raceName;
	}

	public void setRaceName(String raceName) {
		this.raceName = raceName;
	}

	public String getRaceInfo1() {
		return raceInfo1;
	}

	public void setRaceInfo1(String raceInfo1) {
		this.raceInfo1 = raceInfo1;
	}

	public String getRaceInfo2() {
		return raceInfo2;
	}

	public void setRaceInfo2(String raceInfo2) {
		this.raceInfo2 = raceInfo2;
	}

	public String getRaceInfo3() {
		return raceInfo3;
	}

	public void setRaceInfo3(String raceInfo3) {
		this.raceInfo3 = raceInfo3;
	}

	public String getKaisaiNo() {
		return kaisaiNo;
	}

	public void setKaisaiNo(String kaisaiNo) {
		this.kaisaiNo = kaisaiNo;
	}

	public String getRaceNo() {
		return raceNo;
	}

	public void setRaceNo(String raceNo) {
		this.raceNo = raceNo;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getDeadline() {
		return deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public String getDistrictClass() {
		return districtClass;
	}

	public void setDistrictClass(String districtClass) {
		this.districtClass = districtClass;
	}

	public int getProgress() {
		return progress;
	}

	public void setProgress(int progress) {
		this.progress = progress;
	}

	public void setCurrentFlg(int currentFlg) {
		this.currentFlg = currentFlg;
	}

	public int getCurrentFlg() {
		return currentFlg;
	}

	public String getRaceURL() {
		return raceURL;
	}

	public void setRaceURL(String raceURL) {
		this.raceURL = raceURL;
	}

}
